package org.example.api;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

public class RedisHash {
    public static void test1(Jedis jedis){
        jedis.flushDB();
        jedis.hset("key1","zhangsan","88");
        jedis.hset("key1","lisi","55");
        System.out.println(jedis.hget("key1","lisi"));
        System.out.println(jedis.hexists("key1","lisi"));
        System.out.println(jedis.hkeys("key1"));
    }
    public static void main(String[] args) {
        JedisPool jedisPool = new JedisPool("tcp://127.0.0.1:8888");
        try (Jedis jedis = jedisPool.getResource()){
            test1(jedis);
        }
    }
}
